package com.macro.mall.controller;


import com.macro.mall.common.api.CommonResult;
import com.macro.mall.dto.DiscussContentParam;
import com.macro.mall.dto.UsersManParam;
import com.macro.mall.service.SysUsersManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("sys/usersMan")
public class SysUsersManController {

    @Autowired
    private SysUsersManService usersManService;




    /***
     * 获取用户管理列表
     * @param param
     * @return
     */
    @PostMapping("getList")
    public CommonResult getList(@RequestBody UsersManParam param) {
        return usersManService.getList(param);
    }


    /***
     * 获取当前用户管理
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public CommonResult gteUsers(@PathVariable("id") String id) {
        return usersManService.gteUsers(id);
    }


    /****
     * 修改用户管理
     * @param param
     * @return
     */
    @PutMapping
    public CommonResult edit(@RequestBody UsersManParam param) {
        return usersManService.edit(param);
    }


    /***
     * 删除用户管理
     * @param id
     * @return
     */
    @DeleteMapping("/{id}")
    public CommonResult delete(@PathVariable("id") String id) {
        return usersManService.delete(id);
    }


    /****
     * 获取用户评论
     * @param param
     * @return
     */
    @GetMapping("getDiscuss")
    public CommonResult getDiscuss(DiscussContentParam param){
        return usersManService.getDiscuss(param);
    }


    /****
     * 获取用户评论
     * @param param
     * @return
     */
    @GetMapping("getContent")
    public CommonResult getContent(DiscussContentParam param){
        return usersManService.getContent(param);
    }




}
